///@file CameraFactory.cpp source file for class CCameraFactory
///@author	charlie Tan: gths123@gmail.com
#include "CameraFactory.h"
#include "IMyCamera.h"
//! sharpShooter
namespace sharpShooter
{
	//! Scene
	namespace Scene
	{

		CCameraFactory* CCameraFactory::s_Instance = NULL;

		CCameraFactory::CCameraFactory(void)
		{
			m_CameraCount = 0;
		}

		CCameraFactory *CCameraFactory::getSingleton()
		{
			if(s_Instance == NULL)
			{
				s_Instance = new CCameraFactory();
			}
			return s_Instance;
		}

		void CCameraFactory::destroyCameraFatory()
		{
			if( s_Instance != NULL)
			{
				delete s_Instance;
				s_Instance = NULL;
			}
		}

		CCameraFactory::~CCameraFactory()
		{

		}

		IMyCamera * CCameraFactory::createCamera(ISceneManager* smgr,std::string name,double foci, double aperture, Core::Vector3f position,Core::Vector3f lookat)
		{
			m_CameraCount ++;
			IMyCamera *p = NULL;
			p = new IMyCamera(smgr,m_CameraCount,foci,aperture,name,position,lookat);
			assert(p);
			return p;

		}

	}
}